Skip to content

Show full dynamic context in SystemPromptEvent.visualize#2273

Merged
xingyaoww merged 1 commit intomainfrom
show-full-dynamic-context
Mar 3, 2026
Merged

Show full dynamic context in SystemPromptEvent.visualize#2273
xingyaoww merged 1 commit intomainfrom
show-full-dynamic-context

Conversation

@xingyaoww
Copy link
Copy Markdown
Collaborator

@xingyaoww xingyaoww commented Mar 3, 2026

Summary

Remove the 500 character truncation limit for dynamic_context in the SystemPromptEvent.visualize method.

Motivation

When debugging or developing with the SDK, it's useful to see the complete dynamic context to verify that everything is working correctly. The previous truncation to 500 characters made it difficult to inspect the full context being passed to the LLM.

Changes

  • Removed truncation logic that limited dynamic_context to 500 characters with "..." suffix
  • Now displays the full dynamic_context.text content

Before

context_preview = self.dynamic_context.text[:500]
if len(self.dynamic_context.text) > 500:
    context_preview += "..."
content.append(context_preview)

After

content.append(self.dynamic_context.text)

Agent Server images for this PR

GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.12-nodejs22 Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:dc68dcd-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-dc68dcd-python \
  ghcr.io/openhands/agent-server:dc68dcd-python

All tags pushed for this build

ghcr.io/openhands/agent-server:dc68dcd-golang-amd64
ghcr.io/openhands/agent-server:dc68dcd-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:dc68dcd-golang-arm64
ghcr.io/openhands/agent-server:dc68dcd-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:dc68dcd-java-amd64
ghcr.io/openhands/agent-server:dc68dcd-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:dc68dcd-java-arm64
ghcr.io/openhands/agent-server:dc68dcd-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:dc68dcd-python-amd64
ghcr.io/openhands/agent-server:dc68dcd-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-amd64
ghcr.io/openhands/agent-server:dc68dcd-python-arm64
ghcr.io/openhands/agent-server:dc68dcd-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-arm64
ghcr.io/openhands/agent-server:dc68dcd-golang
ghcr.io/openhands/agent-server:dc68dcd-java
ghcr.io/openhands/agent-server:dc68dcd-python

About Multi-Architecture Support

  • Each variant tag (e.g., dc68dcd-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., dc68dcd-python-amd64) are also available if needed

Remove the 500 character truncation limit for dynamic_context in the
visualize method. This helps SDK developers understand if dynamic
context is working correctly by showing the complete content.

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

API breakage checks (Griffe)

Result: Failed

Log excerpt (first 1000 characters)

============================================================
Checking openhands-sdk (openhands.sdk)
============================================================
Comparing openhands-sdk 1.11.5 against 1.11.4
::notice title=openhands-sdk API::Ignoring Field metadata-only change (non-breaking): load_public_skills
::notice title=openhands-sdk API::Ignoring Field metadata-only change (non-breaking): temperature
::warning file=openhands-sdk/openhands/sdk/llm/llm.py,line=196,title=LLM.top_p::Attribute value was changed: `Field(default=1.0, ge=0, le=1)` -> `Field(default=None, ge=0, le=1, description='Nucleus sampling parameter. Defaults to None (uses provider default). Set to a value between 0 and 1 to control diversity of outputs.')`
::error title=SemVer::Breaking changes detected (1); require at least minor version bump from 1.11.x, but new is 1.11.5

============================================================
Checking openhands-workspace (openhands.workspace)
============================

Action log

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

Agent server REST API breakage checks (OpenAPI)

Result: Passed

Action log

@xingyaoww xingyaoww marked this pull request as ready for review March 3, 2026 10:44
Copy link
Copy Markdown
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Good taste

This is exactly the kind of simplification that improves code quality:

  • Eliminates special case logic (no more arbitrary 500-char limit)
  • Reduces 4 lines to 1 line
  • Solves a real problem (debugging difficulty)

The original truncation was arbitrary and made debugging harder. This change is pragmatic—when developers call visualize() for debugging, they want to see the full context.

VERDICT: ✅ LGTM

KEY INSIGHT: Sometimes the best code change is removing code. Arbitrary limits are technical debt.

@xingyaoww xingyaoww merged commit 9f521a4 into main Mar 3, 2026
26 checks passed
@xingyaoww xingyaoww deleted the show-full-dynamic-context branch March 3, 2026 10:48
zparnold added a commit to zparnold/software-agent-sdk that referenced this pull request Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants